<?php
$route->any('login', 'AuthController@login')->name('admin.user.login');

$route->any('qiniu/callback', 'QiNiuController@callback');

//type
$route->get('type/index', 'TypeController@index')->name('admin.type.index');

$route->group(['middleware' => 'api.auth'], function ($route) {
    //管理员
    $route->get('admin/index', 'AdminController@index')->name('admin.admin.index');
    $route->any('admin/info', 'AdminController@info');
    $route->any('admin/destroy', 'AdminController@destroy');
    $route->get('logout', 'AdminController@logout')->name('admin.admin.logout');
    $route->post('admin/store', 'AdminController@store')->name('admin.admin.store');
    $route->post('password/update', 'AdminController@updatePwd')->name('admin.password.update');
    $route->any('reset/password', 'AdminController@resetPassword');

    //banner
    $route->get('banner/index', 'BannerController@index')->name('admin.banner.index');
    $route->get('banner/info', 'BannerController@info')->name('admin.banner.info');
    $route->post('banner/store', 'BannerController@store')->name('admin.banner.store');
    $route->post('banner/destroy', 'BannerController@destroy')->name('admin.banner.destroy');

    //site
    $route->get('config/site', 'ConfigController@site')->name('admin.config.site');
    $route->post('config/site/update', 'ConfigController@update')->name('admin.config.site.update');

    //company
    $route->get('company/type/list', 'CompanyController@typeList')->name('admin.company.type.list');
    $route->get('company/index', 'CompanyController@index')->name('admin.company.index');
    $route->get('company/info', 'CompanyController@info')->name('admin.company.info');
    $route->post('company/store', 'CompanyController@store')->name('admin.company.store');
    $route->post('company/destroy', 'CompanyController@destroy')->name('admin.company.destroy');

    //职位
    $route->get('position/index', 'PositionController@index')->name('admin.position.index');
    $route->get('position/info', 'PositionController@info')->name('admin.position.info');
    $route->post('position/store', 'PositionController@store')->name('admin.position.store');
    $route->post('position/destroy', 'PositionController@destroy')->name('admin.position.destroy');
    $route->post('position/status/set', 'PositionController@setStatus')->name('admin.position.status.set');

    //委托招聘
    $route->get('commissioned/index', 'CommissionedRecruitController@index')->name('admin.commissioned.index');
    $route->post('commissioned/status/set', 'CommissionedRecruitController@setStatus')->name('admin.commissioned.status.set');
    $route->get('commissioned/role', 'ConfigController@commissionedRole')->name('admin.commissioned.role');

    //自荐列表
    $route->get('recommend/index', 'RecommendController@index')->name('admin.recommend.index');
    $route->post('recommend/status/set', 'RecommendController@setStatus')->name('admin.recommend.status.set');

    $route->get('search/category', 'SearchCategoryController@index');

});

